package javacafe.action.study;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import javacafe.action.Action;
import javacafe.action.ActionForward;
import javacafe.dto.study.StudyDTO;
import javacafe.service.StudyService;
import javacafe.serviceimple.StudyServiceImpl;

public class StudyListAction implements Action {

	@Override
	public ActionForward execute(HttpServletRequest request,
			HttpServletResponse response) {

		StudyService service = StudyServiceImpl.getInstance();
		List<StudyDTO> dto = service.getStudyList();
		
		request.setAttribute("studyList", dto);
		
		//forward
		ActionForward forward = new ActionForward();
		forward.setUrl("studyList");
		
		return forward;
	}

}
